from typing import Annotated

from fastapi import APIRouter, Depends

from db.db import AsyncSession, get_session
from db.modality import get_modality
from routers.users import oauth2_scheme


modality_router = APIRouter()


@modality_router.get("/")
async def list_modality(
    token: Annotated[str, Depends(oauth2_scheme)],
    session: AsyncSession = Depends(get_session),
):
    """Возвращает список модальностей."""
    return await get_modality(session=session)
